package com.woniuxy.service;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;

import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageInfo;
import com.woniuxy.dto.PageDto;
import com.woniuxy.entity.Orders;

public interface OrdersService {
	// 根据提交信息生成订单
	@Transactional
	public Boolean addOrders(int p_id, int u_id, BigDecimal auction, BigDecimal service_charge, BigDecimal total_money);

	// 取消单个超时订单
	@Transactional
	public Boolean delOrders(int o_id, int u_id);

	@Transactional
	public Boolean updataOrder(Orders order);

	// 未支付导致流拍
	public Boolean passed(String order_no, int u_id);

	public int updataStatus(String order_no, int status);

	public int updataTime(int o_id);

	public PageInfo<Orders> findOrdersByUid(int u_id, int pageNum, int pageSize);

	public PageInfo<Orders> findOrdersByStatus(int status, int pageNum, int pageSize);

	public Orders findOrdersByOn(String order_no);

	public BigDecimal findYesterday();

	public BigDecimal findSomeday(Date time);

	public BigDecimal findTimeFrame(Date max_time, Date min_time);

	// 根据用户id订单查询订单并做分页
	public PageDto<Orders> find(int uid, int page);

	// 根据订单id删除 订单
	public int del(int o_id);

	// 查找卖家所有订单
	public PageDto<Orders> findsellerorders(int u_id, int page);

	// 通过订单id查找订单详情
	public HashMap<String, Object> findorderdetail(int orderid, int u_id);

}
